package org.sbt.web;



import javax.annotation.Resource;

import org.sbt.mapper.UserMapper;
import org.sbt.model.User;
import org.sbt.service.Demo2Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
public class Test2Controller {
	
	@Resource
	private UserMapper userMapper;
	@Transactional
	@RequestMapping("/test2")
	public String test2Name() {
		userMapper.add(new User(4, "dd"));
		userMapper.add(new User(5, "dx"));
		/*if(true){
			throw new RuntimeException();
		}*/
		
		User u = userMapper.load(1);
//		System.out.println(u);
//		System.out.println(demoService==null);
//		System.out.println(demoService.sayHello("sssssss"));
//		String s = demoService.sayHello("22222");
//		System.out.println(s);
		
		return "hello:"+u;
		
	}
	public static void main(String[] args) {
		System.out.println(run());
	}
	public static int run() {
		int i=1;
		
		try {
			System.out.println(i);
			return ++i;
		} finally {
			System.out.println(++i);
		}
		
	}
}
